#ifndef BULLET_H
#define BULLET_H
#include <QObject>
#include <QPoint>
#include <QPixmap>
#include <QMovie>
class Enemy;                 //第一次修改，2018.9.16  19：40，测试
class Turret;
class Game;
class Bullet
{

public:
    Bullet(int power,int type,int targetType,Game *game,QPoint pos,Enemy *enemy=0,Turret *turret=0);
    //type子弹类型，targetType  0代表目标为敌人，1代表目标为炮塔，
    //Enemy和Turret为目标的指针，默认为0
    ~Bullet();
    void move();
    void UpdateMap();
    void draw(QPainter *painter) const;
private:

    QPoint pos;               //子弹位置
    int targetType;            //目标类型
    int type;                 //子弹类型
    int power;                //子弹威力
    int movespeed;            //子弹移动速度
    Enemy *current_enemy;     //子弹目标敌人
    Turret *current_turret;   //子弹目标炮塔
    Game *game;
    QPixmap sprite;     //图片文件
    QPoint m_currentPos;
    QPoint m_startPos;
    QPoint m_targetPos;
    QMovie *gif;
    double rotationSprite;
private slots:
    void hitTarget();
protected:
};

#endif // BULLET_H
